//引用Vuex
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

import createPersistedState from 'vuex-persistedstate'
const vuexPersisted = new createPersistedState({
    storage: {
        getItem: key => uni.getStorageSync(key),
        setItem: (key, value) => uni.setStorageSync(key, value),
        removeItem: key => uni.removeStorageSync(key)
    },
	key:'xiaoluxian_uniapp'
})
 
import user from './modules/user.js'
//实例store对象
const store = new Vuex.Store({
	modules:{
		user,
	},
	plugins:[vuexPersisted]
})
 
//导出store对象
export default store